<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<title>请选择分支行</title>
		<link rel="stylesheet" type="text/css" href="css/public.css"/>
	</head>
	<style type="text/css">
		/*移动端1px下边线*/
		.border{ position: relative; }
		.border:after{ content: ''; display:block; position: absolute; width: 100%; left: 0px; bottom: 0px;height: 1px; background-color:  #efefef; -webkit-transform: scaleY(0.5); transform: scaleY(0.5);}
		.search{height: 0.64rem;width: 6.8rem;background: #fff;border-radius: 5px;margin: 0.2rem auto;}
		.search input{height: 0.64rem;margin-left: 0.35rem;font-size: 0.3rem;}
		.search .icon{font-size: 0.45rem;font-weight: bold;color: #999;margin-left: 1.85rem;}
		.searchList{height: 11.34rem;overflow: hidden;margin-top: 0.2rem;}
		.list{height: 0.8rem;background: #fff;font-size: 0.3rem;}
		.list img{height: 0.3rem;width: auto;margin-right: 0.35rem;}
		.tisbox .text{font-size: 0.32rem;margin-left: 0.75rem;margin-top: 3.14rem;color: #959595;}
		.tis{height: 1.73rem;background: #fff;margin-top: 0.2rem;}
		.tis .icon{font-size: 0.74rem;color: #0D6FB8;margin-left: 0.37rem;}
		.tis p{font-size: 0.3rem;margin-left: 0.35rem;}
	</style>
	<body>
		<!--头部header开始-->
		<header class="flex flex-align-center">
			<div class="left flex flex-align-center" onclick="Util.back()">
				<img src="img/arrleft.png" alt="" class="arrleft"/>
			</div>
			<div class="title">请选择分支行</div>
			<div class="right flex flex-pack-center flex-align-center">
			</div>
		</header><!--头部header结束-->
		<!--内容开始-->
		<div class="container">
			<div class="search flex flex-align-center">
				<input type="text" id="search" placeholder="请输入xxxx"/>
				<i class="icon iconfont icon-shousuo"></i>
			</div>
			<div id="banklistbox">
				<!--template模板  支行列表/提示框-->
			</div>
		</div><!--内容结束-->
		<script type="text/html" id="wrapperlist">
			<!--列表内容-->
			<div class="searchList" id="wrapper">
				<ul>
				<%for(var i in data){%>
					<li>
						<div class="list border flex flex-align-center" data-bankno="<%= data[i].bankNo %>">
							<p style="margin-left: 0.68rem;" class='flex-1'><%= data[i].subName %></p>
							<img src="img/rightarr.png"/>
						</div>
					</li>
				<%}%>
				</ul>
			</div>
		</script>
		<script type="text/html" id="tisbox_template">
				<!--找不到您要的分支行开始提示-->
			<div class="tisbox" id='tisbox'>
			<div class="tis flex flex-align-center" onclick="Util.jump('choiceBank.html')">
				    <i class="icon iconfont icon-zengjia"></i>
				    <div class="flex flex-v">
				    	<p>找不到您要的分支行？</p>
				    	<p style="margin-top: 0.08rem;color: #626262;">您可以点击此进入，尝试手工输入方式</p>
				    </div>
			</div>
			<p class="text">未搜索到您分支行名字，您可以手工输入</p>
			</div><!--找不到您要的分支行提示开始-->
		</script>
	</body>
	<script type="text/javascript" src="js/rem.js"></script>
	<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="js/template.js"></script>
	<script type="text/javascript" src="js/api.js"></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript" src="js/iscroll.js"></script>
	<script type="text/javascript">
		var cityCode = Util.GetQueryString('cityCode');
		Public.findSubBank({ //拉取支行列表
			areaCode: cityCode,
			bankName:localStorage.shortName,
			subName:''
		},function(res){
			if(res.data.length != 0){
				html = template.render("wrapperlist", res);
				$("#banklistbox").html(html);
					//滚动脚本初始化
				var myScroll = new IScroll('#wrapper', {
					mouseWheel: true,
					click: true,
					tap: true
				});
				//支行列表点击响应事件
				$('.list').on('tap',function(){
					var bankName = Util.trim($(this).text());
					localStorage.branchName = bankName;
					Util.back();
				});
			}else{
				html = template.render("tisbox_template", res);
				$("#banklistbox").html(html);
			}
		});
	$('#search').on('input',function(){
		var subName = $('#search').val();
		Public.findSubBank({ //拉取支行列表
			areaCode: cityCode,
			bankName: localStorage.shortName,
			subName: subName
		},function(res){
			if(res.data.length != 0){
				html = template.render("wrapperlist", res);
				$("#banklistbox").html(html);
					//滚动脚本初始化
				var myScroll = new IScroll('#wrapper', {
					mouseWheel: true,
					click: true,
					tap: true
				});
				//支行列表点击响应事件
				$('.list').on('tap',function(){
					var bankName = Util.trim($(this).text());
					localStorage.branchName = bankName;
					Util.back();
				});
			}else{
				html = template.render("tisbox_template", res);
				$("#banklistbox").html(html);
			}
		});
	});	
	</script>
</html>
